package extrasTours.demo;
import java.util.regex.Pattern;

import presence.demo.R;


import database.demo.PassengersOperations;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

/**
 * saving passenger's details
 */
public class NewExtraMainActivity extends Activity {
	//private PassengersOperations passengerDBoperation;
	EditText tmpID;
	EditText tmpName;
	EditText tmpDescription;
	EditText tmpMature;
	EditText tmpChild;
	
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.new_exra);	
		//passengerDBoperation = new PassengersOperations(this);
		//passengerDBoperation.open();
		addButtonListeners();
	}
	
	public void addButtonListeners() {	 
		Button addButtton = (Button) findViewById(R.id.addextra_Btn);
		//tmpID = (EditText) findViewById(R.id.idText);
		//tmpName = (EditText) findViewById(R.id.nameText);
		//tmpDescription = (EditText) findViewById(R.id.descriptText);
		//tmpMature = (EditText) findViewById(R.id.matureText);
		//tmpDescription = (EditText) findViewById(R.id.descriptText);
		addButtton.setOnClickListener(new OnClickListener() {
		@Override
		public void onClick(View view) {
		
		}
		}); 		
	}
	
	/**	
	public void addUser(View view) {
		EditText tmpID = (EditText) findViewById(R.id.idText);
		EditText tmpName = (EditText) findViewById(R.id.nameText);
		EditText tmpPassport = (EditText) findViewById(R.id.childText);
		EditText tmpPhone = (EditText) findViewById(R.id.matureText);
		EditText tmpEmail = (EditText) findViewById(R.id.emailText);
		
		if(passengerDBoperation.addPassenger(tmpID.getText().toString(), tmpName.getText().toString(),
				tmpPassport.getText().toString(), tmpPhone.getText().toString(),tmpEmail.getText().toString())==null)
		{
			Toast.makeText(NewExtraMainActivity.this,"ID already exists!", Toast.LENGTH_LONG).show();
		}
		else{
		
		AlertDialog alertDialog = new AlertDialog.Builder(this).create();
		alertDialog.setTitle(":)");
		alertDialog.setMessage(tmpName.getText()+" added successfully! ");
		//alertDialog.setMessage(tmpName.getText()+" Added Successfully!");
		alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
		public void onClick(DialogInterface dialog, int which) {
			((EditText) findViewById(R.id.idText)).setText("");
			((EditText) findViewById(R.id.nameText)).setText("");
			((EditText) findViewById(R.id.childText)).setText("");
			((EditText) findViewById(R.id.matureText)).setText("");
			((EditText) findViewById(R.id.emailText)).setText("");
			((EditText) findViewById(R.id.nameText)).requestFocus();
			}
		});
		alertDialog.setIcon(R.drawable.ic_launcher);
		alertDialog.show();
		}
	}**/
}












